app.component("demo-ref",{
    template:`
    <div class="demo-ref">
        <base-input ref="bi"></base-input>
    </div>
    `,
    data(){
        return {}
    },
    methods:{},
    computed:{},

    /* 加载完毕时勒令子组件聚焦 */
    mounted(){
        console.log("父组件加载完毕");

        // 一把抓住子组件并勒令其聚焦那该死的input框
        this.$refs.bi.focusTheFuckingInput()
    }
})

app.component("base-input",{
    template:`
    <input type="text" ref="ip">
    `,

    /* 组件挂载完毕时逮住ip对应的input框 勒令其聚焦  */
    mounted(){
        console.log("子组件加载完毕");
        // this.$refs.ip.focus()
    },

    methods:{
        focusTheFuckingInput(){
            this.$refs.ip.focus()
        }
    }
})